 {*****************************Version: MPL 1.1*********************************
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * Initial Developer : Fajar Khairil
 *
 * Portions created by the Initial Developer are Copyright (C) 2010 - 2011
 * the Initial Developer. All Rights Reserved.
 *
 *******************************************************************************
 * This File is Part of HdFramework OPF Library
 * Copyright (C) 2010 - 2011 HdFramework Developer Team
 *
 * Unit : hade.opf.hdbroker
 * Description : Defining Type of Connection.
                 Currently Support Connection via SQLDB and ZeosLib.
                 in the future it must/will be add XML,JSON,and CSV.
                 currently i don't have time.
                 its also contains sets of certaint type.
 * Author: - Fajar Khairil
 ******************************************************************************}
unit hadeBroker;

{$mode objfpc}{$H+}

{$i ../hddefines.inc}

interface

uses
  Classes,
  SysUtils;

type
  THdBroker = (
            {$IFDEF UIB_BROKER}
            UIB_Firebird,
            {$ENDIF}
            SQLdb_Firebird,
            SQLdb_MySQL,
            SQLdb_SQLite,
            SQLdb_Oracle,
            SQLdb_Postgre,
            SQLDB_ODBC
            );


  THdSetOfHdBroker = set of THdBroker;

var
  //set of SQLDB
  THdSQLdbBroker: THdSetOfHdBroker = [SQLdb_Firebird, SQLdb_MySQL,
                                      SQLdb_SQLite, SQLdb_Oracle,
                                      SQLdb_Postgre,SQLDB_ODBC];
  THadeSetOfFirebird : THdSetOfHdBroker = [SQLDB_Firebird
                                        {$IFDEF UIB_BROKER}
                                        ,UIB_Firebird
                                        {$ENDIF}];

//Helper function
function BrokerAsString(const ABroker: THdBroker): string;

implementation

function BrokerAsString(const ABroker: THdBroker): string;
begin
  Result := '';//<== default
  case ABroker of
    {$IFDEF UIB_BROKER}
    UIB_Firebird:Result:='UIB_Firebird';
    {$ENDIF}
    SQLdb_Firebird: Result := 'SQLdb_Firebird';
    SQLdb_MySQL: Result := 'SQLdb_MySQL';
    SQLdb_SQLite: Result := 'SQLdb_SQLLite';
    SQLdb_Oracle: Result := 'SQLdb_Oracle';
    SQLdb_Postgre: Result := 'SQLdb_Postgre';
    SQLDB_ODBC : Result := 'SQLdb_ODBC';
  end;
end;

end.


